<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box1 {
            width: 500px;
            height: 500px;
            background-color: pink;
        }
        
        #box2 {
            width: 300px;
            height: 300px;
            background-color: green;
        }

        #box3 {
            width: 100px;
            height: 100px;
            background-color: skyblue;
        }
    </style>
</head>
<body>
    <div id="box1">box1
        <div id="box2">box2
            <div id="box3">box3</div>
        </div>
    </div>
<script src="./js/commo.js"></script>
<script>
    var box1 = document.getElementById("box1");
    var box2 = document.getElementById("box2");
    var box3 = document.getElementById("box3");

    // 绑定事件
    bindEvent(box2, "click", function (e) {
        // 事件类型
        console.log(e.type);
        
        // 事件触发的元素
        console.log(e.target);

        // 事件触发该事件的元素
        console.log(e.currentTarget)

        // 事件生成的日期和时间
        console.log(e.timeStamp)
    });
        
</script>
</body>
</html>